{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "import numpy as np\n",
    "from sklearn.model_selection import train_test_split\n",
    "from matplotlib import pyplot as plt\n",
    "from sklearn.model_selection import GridSearchCV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "digits=datasets.load_digits()\n",
    "X=digits.data\n",
    "y=digits.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best k ->  3\n",
      "best_score ->  0.9911111111111112\n",
      "CPU times: user 6.88 s, sys: 37.7 ms, total: 6.92 s\n",
      "Wall time: 6.94 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "k = -1\n",
    "best_score = -1\n",
    "ks=[]\n",
    "bs=[]\n",
    "for i in range(1,11):\n",
    "    knn_cl = KNeighborsClassifier(n_neighbors=i)\n",
    "    X_train,X_test,y_train,y_test=train_test_split(X,y)\n",
    "    knn_cl.fit(X_train,y_train)\n",
    "    c_score = knn_cl.score(X_test,y_test)\n",
    "    ks.append(i)\n",
    "    bs.append(c_score)\n",
    "    if c_score > best_score:\n",
    "        best_score = c_score\n",
    "        k = i\n",
    "print(\"best k -> \",k)\n",
    "print(\"best_score -> \",best_score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a0c7abbe0>]"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0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vgCvAipz1A66R/p+YIz3JH2+mF6m8c8H95jlpFFPhOSx2iRm5QRAEFSLn8k4QBEGwSML0gyAIKkSYfhAEQYUI0w+CIKgQYfpBEAQVIkw/CIKgQoTpB0EQVIgw/SAIggrxB2Kh34mRqtTtAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a0c8f3358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot?\n",
    "plt.plot(ks,bs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best k ->  6\n",
      "best_score ->  0.9933333333333333\n",
      "best_method ->  uniform\n",
      "CPU times: user 1.04 s, sys: 2.04 ms, total: 1.04 s\n",
      "Wall time: 1.04 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "k = -1\n",
    "best_score = -1\n",
    "best_method=\"\"\n",
    "for m in [\"uniform\",'distance']:    \n",
    "    for i in range(1,11):\n",
    "        knn_cl = KNeighborsClassifier(n_neighbors=i,weights=m)\n",
    "        X_train,X_test,y_train,y_test=train_test_split(X,y)\n",
    "        knn_cl.fit(X_train,y_train)\n",
    "        c_score = knn_cl.score(X_test,y_test)\n",
    "        if c_score > best_score:\n",
    "            best_method = m\n",
    "            best_score = c_score\n",
    "            k = i\n",
    "print(\"best k -> \",k)\n",
    "print(\"best_score -> \",best_score)\n",
    "print (\"best_method -> \",best_method)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a15f21e48>,\n",
       " <matplotlib.lines.Line2D at 0x1a15f21cf8>,\n",
       " <matplotlib.lines.Line2D at 0x1a15f21ba8>]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANS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dbGZz5nVDAV5Lsy+AZstPwa93XxNuSXNCtm3qfJXkWg4C8ecHqifRX91X45QzOrBaa6hhboa6FJj7GhtQ1tfE1rL+mMcaSnJLkPuAogxOCZcdYVR0HngSeR8991scDsidpuYdxj/yQ7vWU5NUM/uL9+oLVr6qqI0l+Hrg9yUPdme2k3MvgduXvJ7kC+BzwIjZGn70O+JeqWniWv+79leRUBn/Z31FV3128eYmPTGSMDanrRJuJj7EhdU1tfI3SX0xhjFXVU8DLkpwOfDbJS6tq4fWniYyxk+3M/TBw7oL35wBHVlg/MUkuBD4KXFlV3zmxvqqOdH8eBT7LGF+z1qKqvnvia2JVfRHYnGQLG6DPGMw3Pu3r8nr3V5LNDALhU1V1yxJNpjLGRqhrKmNsWF3TGl+j9Fdn4mNswXH+C/gaPzl99/99k2QT8FwG05j99lnfFxTGfQHbWP7i4Gt5+sWue7r1ZwKPMbjQdUa3fOYE69rKYH7slYvWPxs4bcHyncCOCffZC/jx/QyXAN/q+m8Tg4uC5/HjC14XTKKmbvuJAf3sSfVX99/9CeADK7SZ+Bgbsa6Jj7ER65r4+BqlrimOsRng9G7554B/An5nUZtrefoF1Zu65Qt4+gXVRxnjguqGmpbJGh/GXVXHklwP/Gu3q/fV07+GrXdd72EwZ/bhwXURjtfgHwV6PoOvZTAY7H9bVV/qq64Ra3sD8EdJjgP/DVxVg5F0PMmfAF9m8MuGG6vqwIRqAng98JWq+sGCj653f70KeBPwQDcnCvBuBsE5zTE2Sl3TGGOj1DXx8TViXTCdMXYW8PEkpzCYGbmpqr6Q5H3AXFXdCnwM+GSSQwz+53NVV/eBJDcBDwLHgWtrMMWzJt6hKkkNOtnm3CVJIzDcJalBhrskNchwl6QGGe6S1CDDXZIaZLhLUoMMd0lq0P8B1jFMjUo971IAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a160c2ba8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot([[1,2,3],[1,2,3]],[1,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best k ->  5\n",
      "best_score ->  0.9955555555555555\n",
      "best_p ->  3\n",
      "CPU times: user 15.2 s, sys: 8.57 ms, total: 15.3 s\n",
      "Wall time: 15.3 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "k = -1\n",
    "best_score = -1\n",
    "best_p = -1\n",
    "for i in range(1,11):\n",
    "    for p in range(1,6):\n",
    "        knn_cl = KNeighborsClassifier(n_neighbors=i,weights=\"distance\",p=p)\n",
    "        X_train,X_test,y_train,y_test=train_test_split(X,y)\n",
    "        knn_cl.fit(X_train,y_train)\n",
    "        c_score = knn_cl.score(X_test,y_test)\n",
    "        if c_score > best_score:\n",
    "            best_p = p\n",
    "            best_score = c_score\n",
    "            k = i\n",
    "print(\"best k -> \",k)\n",
    "print(\"best_score -> \",best_score)\n",
    "print (\"best_p -> \",best_p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "param_grid = [\n",
    "    {\n",
    "        'weights':['uniform'],\n",
    "        'n_neighbors':[i for i in range(1,11)]\n",
    "    },\n",
    "    {\n",
    "        'weights':['distance'],\n",
    "        'n_neighbors':[i for i in range(1,11)],\n",
    "        'p':[i for i in range(1,11)]\n",
    "    }\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 29 µs, sys: 1 µs, total: 30 µs\n",
      "Wall time: 32.9 µs\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "gs=GridSearchCV(knn_cl,param_grid,n_jobs=-1,verbose=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 3 folds for each of 110 candidates, totalling 330 fits\n",
      "[CV] n_neighbors=1, weights=uniform ..................................\n",
      "[CV] n_neighbors=1, weights=uniform ..................................\n",
      "[CV] n_neighbors=1, weights=uniform ..................................\n",
      "[CV] n_neighbors=2, weights=uniform ..................................\n",
      "[CV] n_neighbors=2, weights=uniform ..................................\n",
      "[CV] n_neighbors=2, weights=uniform ..................................\n",
      "[CV] n_neighbors=3, weights=uniform ..................................\n",
      "[CV] n_neighbors=3, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=1, weights=uniform, total=   0.5s\n",
      "[CV] ................... n_neighbors=1, weights=uniform, total=   0.5s\n",
      "[CV] n_neighbors=3, weights=uniform ..................................\n",
      "[CV] n_neighbors=4, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=1, weights=uniform, total=   0.5s\n",
      "[CV] n_neighbors=4, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=2, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=4, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=2, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=5, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=2, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=5, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=3, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=5, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=3, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=6, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=3, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=6, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=4, weights=uniform, total=   0.6s\n",
      "[CV] ................... n_neighbors=4, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=6, weights=uniform ..................................\n",
      "[CV] n_neighbors=7, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=4, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=7, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=5, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=7, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=5, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=8, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=5, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=8, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=6, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=8, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=6, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=9, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=6, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=9, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=7, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=9, weights=uniform ..................................\n",
      "[CV] ................... n_neighbors=7, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=10, weights=uniform .................................\n",
      "[CV] ................... n_neighbors=7, weights=uniform, total=   0.7s\n",
      "[CV] n_neighbors=10, weights=uniform .................................\n",
      "[CV] ................... n_neighbors=8, weights=uniform, total=   0.7s\n",
      "[CV] n_neighbors=10, weights=uniform .................................\n",
      "[CV] ................... n_neighbors=8, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=1, p=1, weights=distance ............................\n",
      "[CV] ................... n_neighbors=8, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=1, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=1, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=1, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=1, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=1, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=1, p=3, weights=distance ............................\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=-1)]: Done  25 tasks      | elapsed:    5.6s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] ............. n_neighbors=1, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=1, p=3, weights=distance ............................\n",
      "[CV] ................... n_neighbors=9, weights=uniform, total=   0.7s\n",
      "[CV] n_neighbors=1, p=3, weights=distance ............................\n",
      "[CV] ................... n_neighbors=9, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=1, p=4, weights=distance ............................\n",
      "[CV] ................... n_neighbors=9, weights=uniform, total=   0.6s\n",
      "[CV] n_neighbors=1, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=1, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=3, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=3, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=5, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=6, weights=distance ............................\n",
      "[CV] .................. n_neighbors=10, weights=uniform, total=   0.8s\n",
      "[CV] n_neighbors=1, p=7, weights=distance ............................\n",
      "[CV] .................. n_neighbors=10, weights=uniform, total=   0.8s\n",
      "[CV] n_neighbors=1, p=7, weights=distance ............................\n",
      "[CV] .................. n_neighbors=10, weights=uniform, total=   0.8s\n",
      "[CV] n_neighbors=1, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=5, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=5, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=6, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=1, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=6, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=6, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=7, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=7, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=1, p=7, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=1, p=8, weights=distance, total=   0.5s\n",
      "[CV] ............. n_neighbors=1, p=8, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=1, p=10, weights=distance ...........................\n",
      "[CV] n_neighbors=2, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=8, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=2, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=2, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=2, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=9, weights=distance, total=   0.5s\n",
      "[CV] ............. n_neighbors=1, p=9, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=2, p=2, weights=distance ............................\n",
      "[CV] n_neighbors=2, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=1, p=9, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=2, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=2, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=2, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=2, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=2, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=2, p=4, weights=distance ............................\n",
      "[CV] ............ n_neighbors=1, p=10, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=2, p=4, weights=distance ............................\n",
      "[CV] ............ n_neighbors=1, p=10, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=2, p=5, weights=distance ............................\n",
      "[CV] ............ n_neighbors=1, p=10, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=2, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=2, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=5, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=2, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=4, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=2, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=2, p=6, weights=distance ............................\n",
      "[CV] n_neighbors=2, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=2, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=2, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=2, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=5, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=2, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=2, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=7, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=2, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=2, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=2, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=2, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=2, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=2, p=7, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=2, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=2, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=2, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=2, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=9, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=2, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=3, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=2, p=9, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=2, p=9, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=2, weights=distance ............................\n",
      "[CV] n_neighbors=3, p=2, weights=distance ............................\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] ............ n_neighbors=2, p=10, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=2, weights=distance ............................\n",
      "[CV] ............ n_neighbors=2, p=10, weights=distance, total=   0.5s\n",
      "[CV] n_neighbors=3, p=3, weights=distance ............................\n",
      "[CV] ............ n_neighbors=2, p=10, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=3, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=3, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=3, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=3, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=3, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=3, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=3, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=5, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=3, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=5, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=4, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=3, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=3, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=3, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=3, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=6, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=3, p=7, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=8, weights=distance ............................\n",
      "[CV] n_neighbors=3, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=6, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=6, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=7, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=7, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=3, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=3, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=3, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=3, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=3, p=9, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=9, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=1, weights=distance ............................\n",
      "[CV] ............ n_neighbors=3, p=10, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=3, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=2, weights=distance ............................\n",
      "[CV] ............ n_neighbors=3, p=10, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=3, p=9, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=2, weights=distance ............................\n",
      "[CV] n_neighbors=4, p=3, weights=distance ............................\n",
      "[CV] ............ n_neighbors=3, p=10, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=4, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=4, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=4, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=4, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=4, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=4, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=4, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=4, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=4, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=4, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=4, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=4, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=7, weights=distance ............................\n",
      "[CV] n_neighbors=4, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=4, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=7, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=4, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=8, weights=distance ............................\n",
      "[CV] n_neighbors=4, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=5, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=4, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=4, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=4, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=4, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=4, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=4, p=9, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=4, p=9, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=5, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=5, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=5, p=1, weights=distance ............................\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] ............ n_neighbors=4, p=10, weights=distance, total=   0.6s\n",
      "[CV] ............. n_neighbors=4, p=8, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=5, p=2, weights=distance ............................\n",
      "[CV] n_neighbors=5, p=2, weights=distance ............................\n",
      "[CV] ............ n_neighbors=4, p=10, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=5, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=4, p=9, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=5, p=3, weights=distance ............................\n",
      "[CV] ............ n_neighbors=4, p=10, weights=distance, total=   0.6s\n",
      "[CV] n_neighbors=5, p=3, weights=distance ............................\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=-1)]: Done 146 tasks      | elapsed:   26.0s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] ............. n_neighbors=5, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=5, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=5, p=3, weights=distance ............................\n",
      "[CV] n_neighbors=5, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=5, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=5, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=5, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=5, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=5, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=5, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=5, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=5, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=5, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=5, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=5, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=5, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=5, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=5, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=5, p=8, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=5, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=1, weights=distance ............................\n",
      "[CV] ............ n_neighbors=5, p=10, weights=distance, total=   0.7s\n",
      "[CV] ............ n_neighbors=5, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=2, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=5, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............ n_neighbors=5, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=3, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=6, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=6, p=3, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=6, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=6, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=6, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=6, p=5, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=6, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=6, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=5, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=6, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=6, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=6, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=7, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=6, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=6, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=6, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=6, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=6, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=6, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=6, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=6, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=1, weights=distance ............................\n",
      "[CV] ............ n_neighbors=6, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=6, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=2, weights=distance ............................\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] ............ n_neighbors=6, p=10, weights=distance, total=   0.7s\n",
      "[CV] ............ n_neighbors=6, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=3, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=7, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=7, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=7, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=7, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=7, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=7, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=7, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=7, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=7, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=7, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=7, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=7, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=8, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=7, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=7, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=7, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=7, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=7, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=7, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=7, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=7, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=1, weights=distance ............................\n",
      "[CV] ............ n_neighbors=7, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=8, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=7, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=2, weights=distance ............................\n",
      "[CV] ............ n_neighbors=7, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=7, p=8, weights=distance, total=   0.7s\n",
      "[CV] ............ n_neighbors=7, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=3, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=8, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=8, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=8, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=8, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=8, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=8, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=8, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=8, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=8, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=8, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=4, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=8, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=8, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=6, weights=distance, total=   0.8s\n",
      "[CV] ............. n_neighbors=8, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=7, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=8, p=5, weights=distance, total=   0.8s\n",
      "[CV] ............. n_neighbors=8, p=6, weights=distance, total=   0.8s\n",
      "[CV] ............. n_neighbors=8, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=8, p=10, weights=distance ...........................\n",
      "[CV] n_neighbors=8, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=8, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=8, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=8, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=8, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=1, weights=distance ............................\n",
      "[CV] n_neighbors=9, p=1, weights=distance ............................\n",
      "[CV] ............ n_neighbors=8, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=1, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=8, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=8, p=9, weights=distance, total=   0.7s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] n_neighbors=9, p=2, weights=distance ............................\n",
      "[CV] ............. n_neighbors=8, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=2, weights=distance ............................\n",
      "[CV] n_neighbors=9, p=2, weights=distance ............................\n",
      "[CV] ............ n_neighbors=8, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=3, weights=distance ............................\n",
      "[CV] ............ n_neighbors=8, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=9, p=3, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=9, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=9, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=9, p=4, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............. n_neighbors=9, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=9, p=4, weights=distance ............................\n",
      "[CV] n_neighbors=9, p=5, weights=distance ............................\n",
      "[CV] n_neighbors=9, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=5, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=6, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=7, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=7, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=9, p=6, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=8, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=9, weights=distance ............................\n",
      "[CV] n_neighbors=9, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=9, weights=distance ............................\n",
      "[CV] ............. n_neighbors=9, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=9, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=9, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=9, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=9, p=10, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=9, p=9, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=1, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=9, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=1, weights=distance ...........................\n",
      "[CV] ............. n_neighbors=9, p=8, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=9, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............. n_neighbors=9, p=9, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=1, weights=distance ...........................\n",
      "[CV] n_neighbors=10, p=2, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=9, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=2, weights=distance ...........................\n",
      "[CV] n_neighbors=10, p=2, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=9, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=3, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=9, p=10, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=3, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=1, weights=distance, total=   0.1s\n",
      "[CV] ............ n_neighbors=10, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=10, p=3, weights=distance ...........................\n",
      "[CV] n_neighbors=10, p=4, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=1, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=10, p=4, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............ n_neighbors=10, p=2, weights=distance, total=   0.1s\n",
      "[CV] ............ n_neighbors=10, p=2, weights=distance, total=   0.1s\n",
      "[CV] n_neighbors=10, p=4, weights=distance ...........................\n",
      "[CV] n_neighbors=10, p=5, weights=distance ...........................\n",
      "[CV] n_neighbors=10, p=5, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=5, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=6, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=6, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=6, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=5, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=7, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=7, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=4, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=7, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=3, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=8, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=7, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=8, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=8, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=5, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=9, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=9, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=6, weights=distance, total=   0.8s\n",
      "[CV] n_neighbors=10, p=9, weights=distance ...........................\n",
      "[CV] ............ n_neighbors=10, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=10, weights=distance ..........................\n",
      "[CV] ............ n_neighbors=10, p=7, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=10, weights=distance ..........................\n",
      "[CV] ............ n_neighbors=10, p=8, weights=distance, total=   0.7s\n",
      "[CV] n_neighbors=10, p=10, weights=distance ..........................\n",
      "[CV] ............ n_neighbors=10, p=9, weights=distance, total=   0.8s\n",
      "[CV] ............ n_neighbors=10, p=9, weights=distance, total=   0.7s\n",
      "[CV] ............ n_neighbors=10, p=8, weights=distance, total=   0.8s\n",
      "[CV] ........... n_neighbors=10, p=10, weights=distance, total=   0.8s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] ............ n_neighbors=10, p=8, weights=distance, total=   0.8s\n",
      "[CV] ............ n_neighbors=10, p=9, weights=distance, total=   0.8s\n",
      "[CV] ........... n_neighbors=10, p=10, weights=distance, total=   0.7s\n",
      "[CV] ........... n_neighbors=10, p=10, weights=distance, total=   0.7s\n",
      "CPU times: user 952 ms, sys: 440 ms, total: 1.39 s\n",
      "Wall time: 1min 6s\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=-1)]: Done 330 out of 330 | elapsed:  1.1min finished\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=None, error_score='raise',\n",
       "       estimator=KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski',\n",
       "           metric_params=None, n_jobs=1, n_neighbors=10, p=5,\n",
       "           weights='distance'),\n",
       "       fit_params=None, iid=True, n_jobs=-1,\n",
       "       param_grid=[{'weights': ['uniform'], 'n_neighbors': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}, {'weights': ['distance'], 'n_neighbors': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'p': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}],\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring=None, verbose=2)"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "gs.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'n_neighbors': 1, 'p': 3, 'weights': 'distance'}"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gs.best_params_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.985894580549369"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gs.best_score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "knn_clf=gs.best_estimator_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9911111111111112"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "knn_clf.score(X_test,y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
